package lang

import (
	"math"

	"hundsun.com/hsl/hschain/contract/jvm/jvm.go/native"
	"hundsun.com/hsl/hschain/contract/jvm/jvm.go/rtda"
)

func init() {
	_sm(log, "log", "(D)D")
}

func _sm(method native.Method, name, desc string) {
	native.Register("java/lang/StrictMath", name, desc, method)
}

// public static native long doubleToRawLongBits(double value);
// (D)D
func log(frame *rtda.Frame) {
	value := frame.GetDoubleVar(0)

	// todo
	d := math.Log(value)
	frame.PushDouble(d)
}
